package com.shensi.api.admin.client.coupon;

import com.shensi.api.admin.client.fallback.coupon.CouponUserClientFallBack;
import com.shensi.api.admin.domian.coupon.dto.CouponUserDto;
import com.shensi.api.admin.domian.coupon.vo.CouponUserSumVo;
import com.shensi.common.core.constant.CloudConstant;
import com.shensi.common.core.domain.AjaxResult;
import com.shensi.common.core.page.TableDataInfo;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author: budian
 * @since: 2023/11/30
 */
@FeignClient(
        value = CloudConstant.ADMIN_SERVER,
        fallbackFactory = CouponUserClientFallBack.class)
@Component
public interface CouponUserClient {
    /**
     * 查询人员优惠劵发放方式列表
     */
    @GetMapping("/coupon/user/list")
    public TableDataInfo list(@SpringQueryMap CouponUserDto couponUser);


    /**
     * 手机号查优惠券列表
     */
    @GetMapping("/coupon/user/listByPhone")
    public TableDataInfo listByPhone(@SpringQueryMap CouponUserDto couponUser);


    /**
     * 查询人员优惠劵发放方式列表
     */
    @GetMapping("/coupon/user/getSumCouponUser")
    public CouponUserSumVo getSumCouponUser(@SpringQueryMap CouponUserDto couponUser);


    // 逻辑删除优惠券用户
    @GetMapping("/coupon/user/delete/{id}")
    public ResponseEntity<String> logicDeleteCouponUser(@PathVariable("id") Integer id);

    // 批量逻辑删除优惠券用户
    @PostMapping("/coupon/user/batchDelete")
    public ResponseEntity<String> batchLogicDeleteCouponUser(@RequestBody List<Integer> ids) ;

    /**
     * 导出人员优惠劵发放方式列表
     */
    @GetMapping("/coupon/user/export")
    public AjaxResult export(@SpringQueryMap CouponUserDto couponUser);



    /**
     * 获取人员优惠劵发放方式详细信息
     */
    @GetMapping(value = "/coupon/user/{id}")
    public AjaxResult getInfo(@PathVariable("id") Integer id);

    /**
     * 新增人员优惠劵
     */
    @PostMapping("/coupon/user")
    public AjaxResult add(@RequestBody CouponUserDto couponUser);
    /**
     * 修改优惠劵发放方式
     */
    @PutMapping("/coupon/user")
    public AjaxResult edit(@RequestBody CouponUserDto couponUser);
    /**
     * 删除人员优惠劵发放方式
     */
    @DeleteMapping("/coupon/user/{ids}")
    public AjaxResult remove(@PathVariable("ids") String[] ids);

}
